import request from '@/utils/request'

// 获取角色列表
export const getRoleList = params => request({
  url: '/sys/role',
  params
})

// 获取公司信息
export const companyInfo = id => request({
  url: `/company/${id}`
})

// 删除角色
export const delRole = id => request({
  url: `/sys/role/${id}`,
  method: 'DELETE'
})

// 获取角色详情
export const roleDetail = id => request({
  url: `/sys/role/${id}`
})

// 更新角色
export const updateRole = data => request({
  url: `/sys/role/${data.id}`,
  method: 'PUT',
  data
})

// 新增角色
export const addRole = data => request({
  url: '/sys/role',
  method: 'POST',
  data
})

// 设置权限
export const setRoleAuth = data => request({
  url: '/sys/role/assingPrem',
  method: 'put',
  data
})
